home *** CD-ROM | disk | FTP | other *** search
- // Print value of n
-
- void pdec(int n)
- {
- if (n < 0) // if negative,
- {
- putchar ('-'); // print - sign
- pdec(-n); // and abs value
- }
- else
- {
- if (n > 9) // if more than 1 digit,
- pdec(n/10); // print all but last digit...
-
- putchar(n % 10 + '0'); // print last digit.
- }
- }
-